<!DOCTYPE html>
<html xmlns:c="http://www.w3.org/1999/XSL/Transform">
<head>
    <title>VIP福利</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/userTravels.css"/>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="/js/common.js"></script>
    <script>

        $(function () {
            //当前页
            var currentPage = 1;
            //总页数
            var pages;
            //存储游记的数组
            var travelArr = [];

            function query() {
                //获取我的
                $.get(baseUrl + '/vip/query', {currentPage: currentPage}, function (data) {
                    //把第二个数组合并第一个数组中
                    console.log(data);
                    $.merge(travelArr, data.list);
                    var json = {
                        list: travelArr
                    };
                    //渲染数据
                    $(".strategy").renderValues(json, {
                        getHref: getHref
                    });
                    //console.log(json);

                    //获取总页数
                    pages = data.pages;


                })
                currentPage = currentPage + 1;
            }

            //默认查询第一页
            query();

            //给window绑定滚动事件
            $(window).scroll(function () {
                if ($(window).height() + $(document).scrollTop() + 50 >= $(document).height()) {
                    //如果是小于总页数就发送请求
                    if (currentPage <= pages) {
                        query();
                    } else {
                        $(document).dialog({
                            type: 'notice',
                            content: '<span class="info-text">亲,已经到底了!</span>',
                            autoClose: 2500
                        });
                    }
                }
            });
        });

    </script>
</head>


<body>



<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="javascript:history.go(-1);">
                <span><i class="fa fa-chevron-left fa-2x"></i></span>
            </a>
        </div>


        <div class="col-8">
            <div class="input-group-sm search">
                <p style="color:red; font-size: 20px" >VIP福利</p>
            </div>
        </div>
    </div>

    <div class="mymenu">
        <i class="fa fa-user fa-2x fa-fw " style="color:yellow"></i>
        <a href="/mine/vipProfiles.html" target="_parent"  style="color:wheat">
            :       我的会员</a>
    </div>
</div>



<div class="tab-pane fade active show">

    <div class="container strategy">
        <div render-loop="list">
            <a data-url=" vipContent.html?id=" render-fun="getHref" render-key="list.id">
                <p render-html="list.title" style="color: #3e97ff">标题:</p>
                <img render-src="list.coverUrl" width="100%">
            </a>list
        </div>
    </div>
    <hr>
</div>
</body>
</html>
